/*
 * @Descripttion: GGB
 * @version: 1.0
 * @Author: GGB
 * @Date: 2021-08-17 07:48:30
 * @LastEditors: GGB
 * @LastEditTime: 2021-08-18 16:42:10
 */
import 'package:flutter/material.dart';
import 'package:flutter_data_center/components/loading.dart';
import 'package:flutter_data_center/controller/camera_controller.dart';
import 'package:get/get.dart';

import 'warn_item.dart';

class WarnList extends StatelessWidget {
  const WarnList({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) => GetBuilder<CameraController>(
        builder: (_controller) => _controller.cameraDetail.warnings.length > 0
            ? ListView.builder(
                // shrinkWrap: true,
                physics: BouncingScrollPhysics(),
                itemCount: _controller.cameraDetail.warnings.length,
                itemBuilder: (context, index) => WarnItem(
                  warning: _controller.cameraDetail.warnings[index],
                ),
              )
            : Loading(),
      );
}
